#ifndef HELPERS_HPP__
#define HELPERS_HPP__
#include <tuple>

// This is a workaround to N3305
template <typename T, int N>
constexpr T &constExprGet(const std::tuple<T> &l) {
  return constExprGet({std::forward<T>(l)});
}

template< size_t i, class T >
using Elem = decltype( std::get<i>(std::declval<T>()) );
 
template< size_t i > struct ConstExprGet {
  template< class T >
  constexpr auto operator () ( T&& t )
    -> Elem< i, T >
  {
    return std::get<i>( std::forward<T>(t) );
  }
};

#endif // HELPERS_HPP__
